import React from 'react';
import {messages} from "share/common";
import {Badge} from 'antd'
import selectedImg from 'images/financial-management/selected.png'

export default {
  // 获取标记操作相关列
  getOpinionMsg() {
    return [
      {
        title: messages('financial-management.key888')/*标记*/,
        dataIndex: 'exception',
        key: 'exception',
        width: 60,
        render: value => {
          if (value) {
            return (<img src={selectedImg} style={{width: 12, height: 12}}/>)
          }
        },
        className: 'img-center'
      },
      {
        title: messages('financial-management.key889')/*意见*/,
        dataIndex: 'suggestionMsg',
        key: 'suggestionMsg',
        width: 120,
      },
      {
        title: messages('financial-management.key890')/*系统提示*/,
        dataIndex: 'exceptionMsg',
        key: 'exceptionMsg',
        width: 120,
      },
    ]
  },

  // 获取员工确认状态
  getEmployeeStatus(value) {
    switch (value) {// 'success', 'processing, 'default', 'error', 'warning'
      case 'a':
        return (<Badge text={messages('financial-management.key940')/*未推送*/} status='warning'/>);
      case 'b':
        return (<Badge text={messages('financial-management.key38')/*未确认*/} status='warning'/>);
      case 'c':
        return (<Badge text={messages('financial-management.key37')/*已确认*/} status='warning'/>);
      case 'd':
        return (<Badge text={messages('financial-management.key941')/*拒绝*/} status='warning'/>);
      case 'e':
        return (<Badge text={messages('financial-management.key942')/*自动确认*/} status='warning'/>);
      default:
        return '';
    }
  },

  // 对账相关列
  getCheckStatusAbout() {
    return [
      {
        title: messages('financial-management.key943')/*员工确认状态*/,
        dataIndex: 'a',
        key: 'a',
        width: 120,
        render: (value) => {
          return this.getEmployeeStatus(value);
        }
      },
      {
        title: messages('financial-management.key944')/*确认员工姓名*/,
        dataIndex: 'b',
        key: 'b',
        width: 120,
      },
      {
        title: messages('financial-management.key945')/*确认员工工号*/,
        dataIndex: 'c',
        key: 'c',
        width: 120,
      },
      {
        title: messages('financial-management.key946')/*员工拒绝理由*/,
        dataIndex: 'd',
        key: 'd',
        width: 120,
      },
      {
        title: messages('financial-management.key947')/*对账确认状态*/,
        key: "reconciliationStatus",
        dataIndex: 'reconciliationStatus',
        width: 120,
        render: (value) => value === '2' ?
          <Badge text={messages('financial-management.key38'/*未确认*/)} status='warning'/> :
          <Badge text={messages('financial-management.key37'/*已确认*/)} status='success'/>
      },
      {
        title: messages('financial-management.key948')/*对账确认人工号*/,
        dataIndex: 'confirmUserId',
        key: 'confirmUserId',
        width: 120,
      },
      {
        title: messages('financial-management.key949')/*对账确认人姓名*/,
        dataIndex: 'confirmUserName',
        key: 'confirmUserName',
        width: 120,
      },
      {
        title: messages('financial-management.key950')/*对账确认时间*/,
        dataIndex: 'confirmDate',
        key: 'confirmDate',
        width: 120,
      },
      {
        /*费用状态*/
        title: messages('financial-management.key764')/*费用状态*/,
        key: "isArtInvoice",
        dataIndex: 'isArtInvoice',
        width: 120,
        render: (value) => value ? <Badge text={messages('financial-management.key595')/*已生成*/} status='warning'/> :
          <Badge text={messages('financial-management.key593')/*未生成*/} status='success'/>
      },
    ]
  }

}
